<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <include file="Pub:head" />
    <link rel="stylesheet" href="__PUBLIC__/kindeditor/themes/default/default.css" />
    <script charset="utf-8" src="__PUBLIC__/kindeditor/kindeditor-min.js"></script>
    <script charset="utf-8" src="__PUBLIC__/kindeditor/lang/zh_CN.js"></script>
    <script>
        $(function(){
            var editor;
            KindEditor.ready(function(K) {
                editor = K.create('textarea[name="note"]', {
                    allowFileManager : true,
                    autoHeightMode : true,
                    afterCreate : function() {
                        this.loadPlugin('autoheight');
                    }
                });
            });
        })
    </script>


</head>
<body>
<div class="box1">
    <fieldset style="border-color:#999999;">

        <legend>创建任务</legend>
        <form action="__URL__/addtask" method="post">
            <table class="tableStyle">

                <tr>
                    <td>网站名：</td>
                    <td colspan="2">
                        <input type="text" name="name" id="projectname" value="{$zi['name']}" style="width:200px;" />
                        <input type="hidden" name="projectid" value="{$zi['projectid']}">
                        <input type="hidden" name="site" value="{$zi['id']}">
                    </td>
                </tr>
                <tr>
                    <td>任务类型：</td>
                    <td colspan="2">
                        <select name="type" size="1"  id="tasktype" onChange='setdealine();'>
                            <option>-请选择-</option>
                            <volist name="list" id="vo">
                                <option value="{$vo['id']}" time1="{$vo['time']}">{$vo['name']}</option>
                            </volist>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>任务顺序：</td>
                    <td colspan="2">
                        <input type="text" name="orders" value="1"/>
                    </td>
                </tr>
                <tr>
                    <td >工期：</td>
                    <td colspan="2">
                        <input type="text" name="interval"  id="deadline" value="{$defaulttime}"/>
                    </td>
                </tr>
                <tr>
                    <td>网站资料</td>
                    <td colspan="2">
                        <textarea name="note" style="width:800px;height:400px;visibility:hidden;">
                            <?php echo   htmlspecialchars_decode($zi['pcon'])?> </textarea>
                    </td>
                </tr>

                <tr>
                    <td colspan="3"><input type="submit" value="创建"/></td>
                </tr>
            </table>
        </form>
    </fieldset>

    <script language="javascript" type="text/javascript">

        function setdealine()
        {
           // var tasktime=$("tasktype").find("option:selected").attr("time1");
            var tasktime=$("#tasktype").find("option:selected").attr("time1");
            tasktime=parseInt(tasktime);
            var today=new Date();
            today.setDate(today.getDate() +tasktime);
            var datestr=fundata(today);

         //   $("#deadline").val(datestr);
            $("#deadline").val(tasktime);
            var taskname=$("#tasktype").find("option:selected").text();


            $("#projectname").val( $("#projectname").val()+"-" +taskname);

        }

        function fundata(myDate) {
            var mystr = "";
            mystr = myDate.getFullYear() + "-";
            var month = myDate.getMonth() + 1;
            mystr += month + "-";
            mystr += myDate.getDate() + " ";
            mystr += myDate.getHours() + "-";
            mystr += myDate.getMinutes() + "-";
            mystr += myDate.getSeconds();

            return mystr;
        }
    </script>
</div>
</body>
</html>